
# 安装：pip install openpyxl -i 镜像

# 读取excel数据  转成转成[]的数据

# 1.加载
import openpyxl

# ./还是../目录 运行的目录在哪里
def excel_load(filename):
    # 加载excel
    workbook=openpyxl.load_workbook(filename)
    # workbook 表单
    sheet=workbook["Sheet1"]
    # 读取里面的数据 min_row 从第几行开始  values_only 获取单元格的值
    data=[]
    for i in sheet.iter_rows(min_row=2,values_only=True):
        # print(i)
        # 数据要放在[]中
        # account=i[1]
        # pwd=i[2]
        exmsg=i[1]
        # print(account,pwd,exmsg)
        data.append((exmsg))
    print(data)
    return data